package com.tx.service.impl;

import java.util.List;
import java.util.Map;

import com.tx.dao.MajorDao;
import com.tx.dao.impl.MajorDaoImpl;
import com.tx.service.MajorService;

public class MajorServiceImpl implements MajorService {
    private final MajorDao majorDao = new MajorDaoImpl();

    @Override
    public List<Map<String, Object>> getAllMajors() {
        return majorDao.getAllMajors();
    }

    @Override
    public String getMajorNameById(int majorId) {
        Map<String, Object> major = majorDao.getMajorById(majorId);
        return major != null ? (String) major.get("name") : "未知专业";
    }
} 